package com.sam.demo.config;

import org.springframework.boot.context.properties.ConfigurationProperties;
import org.springframework.context.annotation.Bean;
import org.springframework.context.annotation.Configuration;
import org.springframework.context.annotation.DependsOn;
import org.springframework.data.jpa.repository.config.EnableJpaRepositories;
import org.springframework.orm.jpa.LocalContainerEntityManagerFactoryBean;

import javax.sql.DataSource;

@EnableJpaRepositories(basePackages = "com.sam.demo.repository")
@Configuration
@ConfigurationProperties(prefix = "spring.datasource.secondary")
public class SecondaryDataSourceConfig extends JpaDataSourceConfigCommon {

//	@Bean(name = JpaDataSourceConfigCommon.SECONDAYR_DATASOURCE_KEY)
//	public DataSource dataSource() {
//		return super.dataSource(JpaDataSourceConfigCommon.SECONDAYR_DATASOURCE_KEY);
//	}

	@Bean(name = JpaDataSourceConfigCommon.SECONDAYR_DATASOURCE_KEY)
	public DataSource dataSource() {
		return super.dataSource();
	}

}
